package com.sky.mapper.admin;

import com.sky.pojo.DishFlavor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 口味数据层
 */
@Mapper
public interface FlavorsMapper {

    /**
     * 新增菜品的口味
     * @param flavorList
     */
    void insert(List<DishFlavor> flavorList);

    /**
     * 删除菜品的口味
     * @param ids
     */
    void delete(List<Long> ids);

    /**
     * 根据菜品id查询口味
     * @param id
     * @return
     */
    @Select("select id, dish_id, name, value from dish_flavor where dish_id = #{id}")
    List<DishFlavor> getByDishId(Long id);
}
